class PriceAssess {
  constructor() {
    this.originalPrice = 100
    this.schemes = [this.originalPrice]
  }
  addScheme(price) {
    return this.schemes.push(price)
  }
  getSortedSchemes() {
    let sortedSchemes = Object.assign([], this.schemes).sort((a, b) => {
      return a - b
    })
    return sortedSchemes
  }
  getSuitablePrice(human) {
    let { originalPrice } = this
    let price = originalPrice
    if (human.height <= 100 || human.age < 10) {
      price = 0
      this.addScheme(price)
    }
    if (human.age >= 10 && human.age < 18) {
      price = originalPrice * 0.9
      this.addScheme(price)
    }
    if (human.height > 100 && human.height <= 130) {
      price = originalPrice * 0.5
      this.addScheme(price)
    }
    return this.getSortedSchemes()
  }
}

export class Park {
  constructor() {
    this.priceAssess = new PriceAssess()
  }
  getPrice(human) {
    let price = this.priceAssess.getSuitablePrice(human)
    return price
  }
}

export class Human {
  constructor() {
    this.height = 130
    this.age = 10
  }
}
